from fastapi import APIRouter

from common.ResponseModel import ResponseModel
from model.models import Clas, Student
from .model.StudentModel import ClasVo

student_api = APIRouter()

@student_api.get("/student/{id}")
async def getStudent(id:int):
    student = await Clas.get(id=id)
    return ResponseModel.success(data=student)


@student_api.post("/clas")
async def createClas(clasVo:ClasVo):
    clas = await Clas.create(name=clasVo.name,addr=clasVo.addr)
    return clas